//
//  LSYFastLookExcelTableViewCell.m
//  Cartoon
//
//  Created by dllo on 15/7/15.
//  Copyright (c) 2015年 dllo. All rights reserved.
//
#import "BaseHeader.h"
#import "LSYFastLookExcelTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation LSYFastLookExcelTableViewCell
- (void)dealloc
{
    [_topicModel release];
    [_img release];
    [_titleStr release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.img = [[UIImageView alloc] init];
        [self.contentView addSubview:self.img];
        [_img release];
        self.titleStr = [[UILabel alloc] init];
        [self.contentView addSubview:self.titleStr];
        [_titleStr release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.img.frame = CGRectMake(10 * SCREEN_WIDTH / 375, 10 * SCREEN_HEIGHT / 667, 100 * SCREEN_WIDTH / 375, 50 * SCREEN_HEIGHT / 667);
    self.titleStr.frame = CGRectMake(self.img.frame.origin.x + self.img.frame.size.width + 10 * SCREEN_WIDTH / 375, self.img.frame.origin.y, SCREEN_WIDTH - self.img.frame.origin.x - self.img.frame.size.width - 10 * SCREEN_WIDTH / 375 - 10 * SCREEN_WIDTH / 375, self.img.frame.size.height);
    self.titleStr.numberOfLines = 0;
    self.titleStr.font = [UIFont systemFontOfSize:15];
}

- (void)setTopicModel:(LSYFastLookAllConentModel *)topicModel
{
    [self.img sd_setImageWithURL:[NSURL URLWithString:topicModel.cover_image_url] placeholderImage:[UIImage imageNamed:@""]];
    self.titleStr.text = topicModel.title;
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
